layui.use('table', function() {
	var table = layui.table,layer=layui.layer;
	
	
	var $ = layui.$,
		active = {
			reload: function() {
				var mid = $('#mid').val();
				var start = $('#start').val();
				var end = $('#end').val();

				//执行重载
				table.reload('idTest', {
					page: {
						curr: 1 //重新从第 1 页开始
					},
					where: {
						key: {
							mid:mid,
							start: start,
							end: end
						}
					}
				});
			}
		};

	$('.right-center #ScreenBnt').on('click', function() {
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});
	
	
	layer.msg('数据加载中...', {
		icon: 16,
		shade: 0.3,
		success: function() {
			table.render({
				elem: '#centet-cen',
				url: listSrc,
				height: $(".center-tab").height(),
				id:'idTest',
				response: {
		  			statusCode: 1, //成功的状态码，默认：0
				},          
				page:true,
				cols: [
					[ //标题栏
						{
							field: 'id',
							title: 'ID'
						}, {
							field: 'mid',
							title: '会员编号'
						}, {
							field: 'score',
							title: '当日总业绩'
						}, {
							field: 'day',
							title: '时间（天）'
						}

					]
				],
				limit: 20
			});
			layer.close(layer.index)
		}
	});
	
	
	
})

layui.use(['form', 'layedit', 'laydate'], function(){
	 var form = layui.form,layer = layui.layer,layedit = layui.layedit,laydate = layui.laydate;
	laydate.render({
		elem: '#start'
	});
	laydate.render({
		elem: '#end'
	});
})



$(function(){
	$("#Expbnt").click(function(){
		$("#screen-form").attr("action",ExpSrc);
	})
	
	
	
})